/**********************************************
        CS515  Compilers  Project1
        Fall  2011
**********************************************/

#ifndef HASHTAB_H
#define HASHTAB_H

#include <string.h>
#include "list.h"

/* The symbol table implementation uses a single hash     */
/* function. Starting from the hashed position, entries   */
/* are searched in increasing index order until a         */
/* matching entry is found, or an empty entry is reached. */


typedef struct {
  char *name;
  int id; // unique identifier
  int val; // e.g., + is the value for an add exp, loadi for loadi
  struct node *list;
  struct HashTabEntry *parent;
  struct HashTabEntry *child;
} HashTabEntry;

extern
void InitHashTable();

extern
HashTabEntry * hashLookup(char *name);

extern
void hashInsert(char *name);

extern
void PrintHashTable();


#endif
